<template>
	<view>
		<view class="item"
			@click="$pub.go(`/pages_home/articleDetail/articleDetail?data=${encodeURIComponent(JSON.stringify(data))}`)">
			<!-- <view class="title text-ellipsis">江西：预测2023年1月上旬达到感染高峰 现存两种变异株</view> -->
			<view class="title text-ellipsis">{{data.title}}</view>
			<view class="content flex-row">
				<view class="info">
					<!-- <view class="summary">新京报讯 据江西发布消息，江西省新冠肺炎疫情防控工作新闻发布会（第三十八场）在南昌召开，会上介绍了我省下一步新冠肺炎疫情防控工作的相关情况。</view> -->
					<view class="summary">{{data.content}}</view>
					<view class="flex-row">
						<text class="date">{{data.createTime}}</text>
						<text class="views">200 阅读</text>
					</view>
				</view>
				<view class="cover">
					<image class="img" src="https://cdn.uviewui.com/uview/resources/codeFun.jpg">
					</image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "card",
		data() {
			return {
				list: []
			};
		},
		props: {
			data: {
				// type: Object,
				defaul: null,
			},
		},
		created() {
			console.log(this.data, "data");
		},
		methods: {

		},
	}
</script>


<style lang="scss" scoped>
	.item {
		padding: 30rpx;
		// margin-bottom: 30rpx;
		background-color: #FFF;

		.title {
			font-weight: bold;
			padding-bottom: 30rpx;
			border-bottom: 2rpx solid #F5F5F5;
		}

		.content {
			padding-top: 30rpx;
			align-items: flex-start;

			.info {
				width: calc(100% - 160rpx);

				.summary {
					color: #777;
					height: 80rpx;
					font-size: 24rpx;
					line-height: 1.6;
					margin-bottom: 10rpx;
					@include text-ellipsis(2);
				}

				.date {
					font-size: 24rpx;
					color: $main-color;
					opacity: 0.6;
				}

				.views {
					color: #999;
					font-size: 24rpx;
				}
			}

			.cover {
				width: 140rpx;
				height: 120rpx;

				.img {
					width: 100%;
					height: 100%;
					border-radius: 4rpx;
				}
			}
		}
	}
</style>